package com.macro.mall.commissiontask.job;

import com.macro.mall.common.api.constants.EnvironmentNameConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 生活订单结算任务
 *
 * @author xuyanjun
 * @date 2019-09-02
 */
@Profile(value = {EnvironmentNameConstants.DEV, EnvironmentNameConstants.TEST})
@Component
public class OrderSettleJobForDev {

    /**
     * 执行间隔
     */
    private static final long EXECUTE_INTERVAL = 20 * 1000L;

    @Autowired
    private OrderSettleHandler orderSettleHandler;

    @Autowired
    private OrderPredictHandler orderPredictHandler;


    @Scheduled(fixedDelay = EXECUTE_INTERVAL)
    public void execute() {
        orderSettleHandler.execute();
    }
//
//    @Scheduled(fixedDelay = EXECUTE_INTERVAL)
//    public void executePredict() {
//        orderPredictHandler.execute();
//    }
}
